var t = getApp();

Page({
    data: {
        id: "",
        page: 1,
        keyword: ""
    },
    onLoad: function(t) {
        this.setData({
            id: t.id
        }), this.getStatus();
    },
    keyword: function(t) {
        var a = t.detail.value;
        this.setData({
            keyword: a
        });
    },
    gettap: function() {
        this.setData({
            page: 1,
            current_page: 1,
            last_page: 1
        }), this.getSearch();
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (this.data.current_page >= this.data.last_page) wx.showToast({
            title: "没有更多了",
            icon: "none",
            duration: 1e3
        }); else {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getSearch();
        }
    },
    onShareAppMessage: function() {},
    getSearch: function() {
        var a = {
            keyword: this.data.keyword,
            status: 1,
            auc_status: "",
            is_new: "",
            is_recommend: "",
            auctioneer_id: this.data.id,
            art: "getSearch",
            page: this.data.page,
            is_pass: this.data.status ? "1" : "0"
        }, e = this, s = t.getNetAddresss("plugin.auction.api.index.getAuctionData");
        t._getNetWork({
            url: s,
            data: a,
            success: function(t) {
                var a = t.data;
                1 == a.result ? (console.log(a), e.setData({
                    datas: a.data.getSearch.data,
                    current_page: a.data.getSearch.current_page,
                    last_page: a.data.getSearch.last_page
                })) : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getStatus: function() {
        var a = this, e = t.getNetAddresss("plugin.auction.api.index.getAuctionData"), s = {
            member_id: this.data.id
        };
        t._getNetWork({
            url: e,
            data: s,
            success: function(t) {
                var e = t.data;
                1 == e.result ? (a.setData({
                    status: e.data.getVerify.status
                }), a.getSearch()) : wx.showToast({
                    title: res.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t), wx.showToast({
                    title: t.msg,
                    icon: "none",
                    duration: 1e3
                });
            }
        });
    }
});